﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:MessageBoxUtils">
    <Style TargetType="{x:Type local:WPFMessageBoxControl}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:WPFMessageBoxControl}">
                    <Grid FlowDirection="{Binding ContentFlowDirection}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="55" />
                            <RowDefinition Height="2" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="40" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="60" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>

                        <Image Source="{Binding MessageImageSource}"
                               HorizontalAlignment="Left"
                               VerticalAlignment="Center"
                               Height="32"
                               Width="32"
                               Margin="10 0 0 0" />

                        <TextBlock Text="{Binding Message}"
                                   Grid.RowSpan="2"
                                   Grid.Column="1"
                                   TextWrapping="Wrap"
                                   TextAlignment="Left"
                                   HorizontalAlignment="{Binding ContentTextAlignment}"
                                   VerticalAlignment="Top"
                                   Margin="10 10 10 10" />

                        <Border Grid.Row="3"
                                Grid.Column="0"
                                Grid.ColumnSpan="2"
                                Background="#FFE6E6E6"
                                BorderThickness="0 1 0 0"
                                BorderBrush="#FFDFDFDF">
                            <StackPanel Orientation="Horizontal"
                                        VerticalAlignment="Center"
                                        HorizontalAlignment="Right"
                                        Margin="0 0 5 0">
                                <Button x:Name="PART_YesButton"
                                        Content="_Yes"
                                        Visibility="{Binding YesNoVisibility}"
                                        Command="{Binding YesCommand}"
                                        IsDefault="{Binding IsYesDefault}"
                                        Margin="5 5 5 5"
                                        Height="24"
                                        Width="80" />
                                <Button x:Name="PART_NoButton"
                                        Content="_No"
                                        Visibility="{Binding YesNoVisibility}"
                                        Command="{Binding NoCommand}"
                                        IsDefault="{Binding IsNoDefault}"
                                        Margin="5 5 5 5"
                                        Height="24"
                                        Width="80" />
                                <Button x:Name="PART_OkButton"
                                        Content="O_K"
                                        Visibility="{Binding OkVisibility}"
                                        Command="{Binding OkCommand}"
                                        IsDefault="{Binding IsOkDefault}"
                                        Margin="5 5 5 5"
                                        Height="24"
                                        Width="80" />
                                <Button x:Name="PART_CancelButton"
                                        Content="_Cancel"
                                        Visibility="{Binding CancelVisibility}"
                                        Command="{Binding CancelCommand}"
                                        IsDefault="{Binding IsCancelDefault}"
                                        Margin="5 5 5 5"
                                        Height="24"
                                        Width="80" />
                            </StackPanel>
                        </Border>
                    </Grid>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
